#!/usr/bin/env perl
#redo 重新执行当前的迭代
#next 跳过当前的迭代 执行下次迭代
use utf8;
use strict;

my @words = qw {fred barney pebbles dino wilma betty};
my $error = 0;

foreach(@words){
	##redo jump here
	print "Type the word '$_':";
	chomp(my $input = <STDIN>);
	if($input ne $_){
		print "SOrry - That's not right.\n\n";
		$error ++;
		redo;
	}
}

print "You've completed the test, with $error errors.\n";
